package com.px.service.service.impl;

import java.util.List;
import com.px.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.px.service.mapper.WorshipBackgroundMapper;
import com.px.service.domain.WorshipBackground;
import com.px.service.service.IWorshipBackgroundService;

/**
 * 祭扫背景图片Service业务层处理
 * 
 * @author 品讯科技
 * @date 2024-08
 */
@Service
public class WorshipBackgroundServiceImpl implements IWorshipBackgroundService 
{
    @Autowired
    private WorshipBackgroundMapper worshipBackgroundMapper;

    /**
     * 查询祭扫背景图片
     * 
     * @param id 祭扫背景图片主键
     * @return 祭扫背景图片
     */
    @Override
    public WorshipBackground selectWorshipBackgroundById(Long id)
    {
        return worshipBackgroundMapper.selectWorshipBackgroundById(id);
    }

    /**
     * 查询祭扫背景图片列表
     * 
     * @param worshipBackground 祭扫背景图片
     * @return 祭扫背景图片
     */
    @Override
    public List<WorshipBackground> selectWorshipBackgroundList(WorshipBackground worshipBackground)
    {
        return worshipBackgroundMapper.selectWorshipBackgroundList(worshipBackground);
    }

    /**
     * 新增祭扫背景图片
     * 
     * @param worshipBackground 祭扫背景图片
     * @return 结果
     */
    @Override
    public int insertWorshipBackground(WorshipBackground worshipBackground)
    {
        worshipBackground.setCreateTime(DateUtils.getNowDate());
        return worshipBackgroundMapper.insertWorshipBackground(worshipBackground);
    }

    /**
     * 修改祭扫背景图片
     * 
     * @param worshipBackground 祭扫背景图片
     * @return 结果
     */
    @Override
    public int updateWorshipBackground(WorshipBackground worshipBackground)
    {
        worshipBackground.setUpdateTime(DateUtils.getNowDate());
        return worshipBackgroundMapper.updateWorshipBackground(worshipBackground);
    }

    /**
     * 批量删除祭扫背景图片
     * 
     * @param ids 需要删除的祭扫背景图片主键
     * @return 结果
     */
    @Override
    public int deleteWorshipBackgroundByIds(Long[] ids)
    {
        return worshipBackgroundMapper.deleteWorshipBackgroundByIds(ids);
    }

    /**
     * 删除祭扫背景图片信息
     * 
     * @param id 祭扫背景图片主键
     * @return 结果
     */
    @Override
    public int deleteWorshipBackgroundById(Long id)
    {
        return worshipBackgroundMapper.deleteWorshipBackgroundById(id);
    }
}
